﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Web.App.Infrastructure.ApplicationMessages.Contracts;
using Web.App.Infrastructure.ApplicationMessages.Implementation;

namespace Webshop20.Domain.Common.Exceptions
{
    public class DomainException : Exception
    {
        public IDomainMessage DomainMessage { get; private set; }

        public DomainException(IDomainMessage domainMessage)
        {
            DomainMessage = domainMessage;
        }
    }

    public class ValidationException<T> 
    {
        public IEnumerable<T> ValidationFailures { get; private set; }

        public ValidationException(IEnumerable<T> validationFailures)
        {
            ValidationFailures = validationFailures;
        }
    }

    public class SpecificationException<T> 
    {
        public IEnumerable<T> SpecificationFailures { get; private set; }

        public SpecificationException(IEnumerable<T> specificationFailures)
        {
            SpecificationFailures = specificationFailures;
        }
    }
}